import { pid } from "process"


const envRoot={
	development:"https://127.0.0.1:8000",
	production:"https://aaapi.464373424.xyz"
}

// const envRoot={
// 	development:"https://8.134.202.25:8000",
// 	production:"https://8.134.202.25:8000"
// }

console.log(`当前环境${process.env.NODE_ENV}`)

let  root=envRoot[process.env.NODE_ENV]

export default {
    common:{
        captcha:()=>root+"/common/captcha",
        captchaPhone:()=>root+"/common/captcha/phone"
    },
    user:{
        login:()=>root+"/user/login",
        logout:()=>root+"/user/logout",
        uploadAvatar:()=>root+"/user/upload/avatar",
        updMyInfo:(field)=>root+"/user/myinfo/upd/"+field,
        checkLogin:()=>root+"/user/chkLogin",
        register:()=>root+"/user/register",
        search:()=>root+"/user/search"
    },
    message:{
        list:()=>root+"/project/message/list",
        read:(mid)=>root+"/project/message/read/"+mid,
        readAll:()=>root+"/project/message/readAll/",
    },
    project:{
        getReportData:(pid)=>root+"/project/get_report_data/"+pid,
        add:()=>root+"/project/add",
        upd:()=>root+"/project/upd/",
        delete:(id)=>root+"/project/delete/"+id,
        get:(id)=>root+"/project/get/"+id,
        list:()=>root+"/project/list",
        quit:(id)=>root+"/project/quit/"+id,
        userList:()=>root+"/project/user/list",
        groupAdd:()=>root+"/project/group/add",
        groupList:()=>root+"/project/group/list",
        groupUpd:(id)=>root+"/project/group/upd/"+id,
        groupJoin:(id)=>root+"/project/group/join/"+id,
        groupDel:(id)=>root+"/project/group/del/"+id,
        groupGet:(id)=>root+"/project/group/get/"+id,
        invite:()=>root+"/project/invite",
        inviteData:(pid)=>root+"/project/invite/"+pid,
        join:(id)=>root+"/project/join/"+id,
        transfer:(pid)=>root+"/project/transfer/"+pid,
        deleteUsers:()=>root+"/project/user/del",
        detail:{
            add:()=>root+"/project/details/add",
            del:(id)=>root+"/project/details/del/"+id,
            upd:(id)=>root+"/project/details/upd/"+id,
            list:()=>root+"/project/details/list",
            get:(id)=>root+"/project/details/get/"+id,
        }
    }
}